//- Copyright (c) 2016 Lucky Byte, Inc.
extends trstat

append form_items
  .field.nine.wide
    .ui.buttons.right.floated.small.compact
      button.ui.green.button.labeled.icon(type="submit") 查 询
        i.icon.search

block thead
  tr
    th.collapsing.center.aligned(colspan="2") 助农取款
    th.collapsing.center.aligned(colspan="4") 代付成功
    th.collapsing.center.aligned(colspan="2") 代付失败
    th.collapsing.center.aligned(colspan="2") 尚未代付
    th.collapsing.center.aligned(colspan="2") 尚未确认
  tr
    th.collapsing.center.aligned(rowspan="2") 笔 数
    th.collapsing.center.aligned(rowspan="2") 金 额
    th.collapsing.center.aligned(rowspan="2") 笔 数
    th.collapsing.center.aligned(rowspan="2") 金 额
    th.collapsing.center.aligned(colspan="2") 手续费
    th.collapsing.center.aligned(rowspan="2") 笔 数
    th.collapsing.center.aligned(rowspan="2") 金 额
    th.collapsing.center.aligned(rowspan="2") 笔 数
    th.collapsing.center.aligned(rowspan="2") 金 额
    th.collapsing.center.aligned(rowspan="2") 笔 数
    th.collapsing.center.aligned(rowspan="2") 金 额
  tr
    th.collapsing.center.aligned 资金池
    th.collapsing.center.aligned 代付交易

block tbody
    tr
      td.collapsing.center.aligned= t60_stats.count || 0
      td.collapsing.center.aligned ¥ #{fmtamt(t60_stats.amt)}
      td.collapsing.center.aligned= t40_status_4.count || 0
      td.collapsing.center.aligned ¥ #{fmtamt(t40_status_4.amt)}
      td.collapsing.center.aligned ¥ #{fmtamt(t40_status_4.fee_from_1)}
      td.collapsing.center.aligned ¥ #{fmtamt(t40_status_4.fee_from_2)}
      if t40_status_3.count > 0
        td.collapsing.center.aligned.error= t40_status_3.count || 0
        td.collapsing.center.aligned.error ¥ #{fmtamt(t40_status_3.amt)}
      else
        td.collapsing.center.aligned= t40_status_3.count || 0
        td.collapsing.center.aligned ¥ #{fmtamt(t40_status_3.amt)}
      if t40_status_1.count > 0
        td.collapsing.center.aligned.error= t40_status_1.count || 0
        td.collapsing.center.aligned.error
          | ¥ #{fmtamt(t40_status_1.amt - t40_status_1.fee)}
      else
        td.collapsing.center.aligned= t40_status_1.count || 0
        td.collapsing.center.aligned
          | ¥ #{fmtamt(t40_status_1.amt - t40_status_1.fee)}
      if t40_status_2.count > 0
        td.collapsing.center.aligned.error= t40_status_2.count || 0
        td.collapsing.center.aligned.error ¥ #{fmtamt(t40_status_2.amt)}
      else
        td.collapsing.center.aligned= t40_status_2.count || 0
        td.collapsing.center.aligned ¥ #{fmtamt(t40_status_2.amt)}
